#include "rbtree.hpp"

using namespace std;
void banner()
{
    cout << "\033[1;33mPlease input\033[0m [option, data]\n"
         << "\033[1;32m0 - insert\n"
         << "1 - erase\033[0m\n\n";
}
int main(int argc, char** argv)
{
    {
        RBTree tree;
    }
    RBTree tree;
    tree.insert(10);
    tree.insert(9);
    tree.insert(8);
    tree.insert(7);
    tree.insert(6);
    tree.insert(5);
    tree.insert(4);
    cout << "Default input 10, 9, 8, 7, 6, 5, 4\n";
    tree.print();
    int op, data;
    while (cin >> op >> data)
    {
        switch (op)
        {
            case 0:
                tree.insert(data);
                break;
            case 1:
                tree.erase(data);
                break;
            default:
                cout << "Wrong input\n";
                break;
        }
        tree.print();
        banner();
    }
    return 0;
}